﻿using Edge.Repository.Base;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Edge.Repository.Model.CameraSys.CDal
{
    // internal class CameraService

    public class CameraService : BaseRepository<CameraConfigModel>
    {
    }

    public class CameraDataService : BaseRepository<CameraDataModel>
    {

        public List<CameraDataModel> GetList(DateTime dateTimeA, DateTime dateTimeB, int pid, int jiange)
        {
            List<CameraDataModel> outList = new List<CameraDataModel>();
            outList = this.Db.Ado.SqlQuery<CameraDataModel>(" SELECT * from (select *, ROW_NUMBER() OVER(ORDER BY id) AS rowno from Camera_Data where  pid =" + pid + " and   CreateTime>'" + dateTimeA.ToString("yyyy-MM-dd HH:mm:ss") + "' and CreateTime<'" + dateTimeB.ToString("yyyy-MM-dd HH:mm:ss") + "' ) as t   where  t.rowno % " + jiange + "=1  ");
            return outList;
        }

    }


}
